const { defineConfig } = require('@vue/cli-service');
const path=require("path");

module.exports = defineConfig({
    transpileDependencies: true,
    lintOnSave:false,
    css: {
        sourceMap: true
    },
    devServer: {
        open: true,
        host: "localhost",
        port: "9527",
        https: false,
        proxy:{
            "/Qilin":{
                // target:"http://47.102.142.191:8088/",
                target:"http://36.133.182.11:8088/",
                changeOrigin:true,
                pathRewrite:{
                    "^/Qilin":""
                },
                logLevel:"debug"
            }
        }
    },
    configureWebpack:{
        resolve:{
            alias:{
                "@":path.resolve(__dirname,"src"),
                "$scss":path.resolve(__dirname,"src/assets/scss")
            }
        }
    },
    chainWebpack:(config)=>{
        const oneOfsMap=config.module.rule("scss").oneOfs.store;
        oneOfsMap.forEach((item)=>{
            item
                .use("sass-resources-loader")
                .loader("sass-resources-loader")
                .options({
                    resources:"src/assets/scss/common.scss"
                })
                .end()
        });
        config.plugin("html").tap((args)=>{
            args[0].title="职级管理";
            return args;
        });
    }
})
